package com.example.navigation.controller;

import com.example.navigation.config.BaiduMapsConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class WebController {

    private final BaiduMapsConfig baiduMapsConfig;

    @Autowired
    public WebController(BaiduMapsConfig baiduMapsConfig) {
        this.baiduMapsConfig = baiduMapsConfig;
    }

    @GetMapping("/")
    public String index(Model model) {
        model.addAttribute("apiKey", baiduMapsConfig.getApiKey());
        return "index";
    }
} 